#!/bin/sh

#一行一行打印


usage()
{
	echo "Today's date is `date`"
	echo "The software's usage"
}

ipv6()
{
	echo "请选择策略，A或者B，首选为B"
	read scheme
	if [ "$scheme" = "B" ]; then
		B
	else
		A
	fi
}

B() 
{
	echo "首选B策略"
	echo "ASN+IPv4Perfix+随机数"	
}

A()
{
	echo "A group"
}

ipv4()
{
	echo "IPv4 perfix"
#创建存储表的文件
	if [ -e yiyi ]; then
		echo "已经有yiyi"
	else
		touch yiyi
	fi
#创建表	
	echo 请输入i的值
	read i
	j=0

	while [ "$j" -lt "$i" ]; do
		echo -e $j >> yiyi
		j=`expr $j + 1`
	done
}

case "$1" in
	IPv4) echo "IPv4 table"
	      ipv4;;
	IPv6) echo "IPv6 table"
	      ipv6;;
	* | h* | H*)    usage;;
esac

exit 0
